package com.eiisan.security.service;

import org.springframework.security.core.userdetails.*;
import org.springframework.stereotype.Component;

/**
 * @author eii
 * @sice 2020/11/6
 */
@Component
public class CustomUserDetailsService implements UserDetailsService {

    @Override
    public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
        UserDetails user = User.withDefaultPasswordEncoder()
                .username("admin")
                .password("{bcrypt}$2a$10$mqK.N0qKK6vcdEi74xfUCe2OL4m7UkeugXlCSSHDS/gx777MNiM3i")
                .roles("admin")
                .build();
        return user;
    }

}
